<?php


namespace Xiaoguai\DesignPattern\DP016;


/**
 * 存储和提供状态
 * Class Memento
 * @package Xiaoguai\DesignPattern\DP016
 */
class Memento
{
    /**
     * @var string $state
     */
    protected $state;

    public function __construct(string $state)
    {
        $this->state = $state;
    }

    /**
     * @param string $state
     */
    public function setState(string $state): void
    {
        $this->state = $state;
    }

    /**
     * @return string
     */
    public function getState(): string
    {
        return $this->state;
    }
}